package com.net.Thread;

class TestRunnable implements Runnable
{

	@Override
	public void run()
	{
      System.out.println(Thread.currentThread().getName() + "  thread");
		
      try
      {
		Thread.sleep(1000);
	  } catch (Exception e) 
	  {
		
	  }
	}
	
}

public class JoinTest 
{

	public static void main(String[] args) throws InterruptedException
	{
		TestRunnable test = new TestRunnable();
		
		Thread t1 = new Thread(test, "t1");
		Thread t2 = new Thread(test, "t2");
		Thread t3 = new Thread(test, "t3");
		Thread t4 = new Thread(test, "t4");
		
		t1.start();
		t1.join();
		t3.start();
		t3.join();
		t2.start();
		
		
		

	}

}
